set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON

IF OBJECT_ID ('esGET_QUEUE_ATTRIBUTE_EVENTS_ARCHIVE', 'P') IS NOT NULL
   DROP PROCEDURE [dbo].[esGET_QUEUE_ATTRIBUTE_EVENTS_ARCHIVE]
GO

-- Create Start (DO NOT DELETE)
CREATE Procedure esGET_QUEUE_ATTRIBUTE_EVENTS_ARCHIVE
AS
BEGIN
	SET NOCOUNT ON
	
	SELECT events.ID, sfa.Name, events.ProjectName, OldValue, NewValue
	FROM esQUEUE_ATTRIBUTE_EVENTS_ARCHIVE as events
		INNER JOIN sfATTRIBUTES as sfa
		ON ((sfa.ID = events.AttributeID) and (sfa.AccountID = events.AccountID))
END

-- Create End (DO NOT DELETE)
GO

-- Create Extended Property Start (DO NOT DELETE)
EXEC sys.sp_addextendedproperty @name=N'Version', @value=N'2007.6.25.1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'esGET_QUEUE_ATTRIBUTE_EVENTS_ARCHIVE'
-- Create Extended Property End (DO NOT DELETE)

-- Read Extended Property Start (DO NOT DELETE)
SELECT value FROM fn_listextendedproperty(N'Version', N'SCHEMA', N'dbo', N'PROCEDURE', N'esGET_QUEUE_ATTRIBUTE_EVENTS_ARCHIVE', default, default);
-- Read Extended Property End (DO NOT DELETE)

GO
